var contextPath='';

$(document).ready(function()
{
   contextPath = '/'+document.URL.split('/')[3];
   body_onload();

});

function body_onload()
{
  	$('#content_infoprod').load(contextPath+'/pages/jsp/includes/bar_prods.jsp');
	$('#header').load(contextPath+'/includes/pages/jsp/header.jsp');
	$('#menu_modificaciones').load(contextPath+'/pages/jsp/includes/modificaciones.jsp');
	$('#nombre_cliente').load(contextPath+'/pages/jsp/includes/cliente_detalles.jsp');
	$('#nombre_cliente_activo').load(contextPath+'/pages/jsp/includes/cliente_detalles_activo.jsp');
	$('#apertura_cuentas').load(contextPath+'/pages/jsp/includes/menu_cuentas.jsp');
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function ver_contenido(div,url){
	$('#'+div).load(url,function(){$(this).show()});
}
function cerrar_contenido(e){
	$('#'+e).slideUp("slow");
}

function cerrar(e){
	$('#'+e).slideUp(150);
}
function ver_divOculto(e){
	$('#'+e).show();
}
function ocultar_modal(){
	$('#divmod').html('');
	$.modal.close();
}

function mostrar_modal(url,divWidth,divHeight,closeBtn){
		
		$('#divmod').load(url,function(){
			if(closeBtn== 0){$('#divmod').modal({close:false});} else{$('#divmod').modal({close:true});}
			if(divWidth != '') { $('#simplemodal-container').css('width',divWidth+'px'); }
			if(divHeight != '') {$('#simplemodal-container').css('height',divHeight+'px');}
			$(window).trigger('resize.simplemodal');
		});
}

function showInfoProd(e){
	if($('#btns_infoprods').is(":visible") == false){
	$('#'+e).css('height','76px');
	$('#'+e).css('top','524px');
	$('#btns_infoprods').toggle();
	$('#triangle_info').attr('src',contextPath+'/imagenes/estructura/triangulo_abajo.gif');
	}
	else{
	$('#'+e).css('height','25px');
	$('#'+e).css('top','575px');
	$('#btns_infoprods').toggle();
	$('#triangle_info').attr('src',contextPath+'/imagenes/estructura/triangulo_arriba.gif');	
	}
}